<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
	<ui:composition template="/templateAdm.xhtml">	
		<ui:define name="conteudoAdm">
			<div class="control">
				<h:form id="form4" action="${url}">
					<h:dataTable value="#{cadastroMateria.lista}" var="item" border="1">
						<h:column>
							<f:facet name="header">
								<h:outputText id="id" value="ID">ID</h:outputText>
							</f:facet>	
								<h:outputText value="#{item.idmateria}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="titulo" value="TITULO"></h:outputText>
							</f:facet>	
								<h:outputText value="#{item.titulo}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="data" value="DATA CRIACAO"></h:outputText>
							</f:facet>	
								<h:outputText  value="#{item.dataCriacao}">
									<f:convertDateTime type="both"/> 
								</h:outputText>
						</h:column>
						
						<h:column>
							<f:facet name="header">
								<h:outputText id="excluir" value="Excluir"></h:outputText>
							</f:facet>	
								<h:commandLink action="#{cadastroMateria.Excluir}" value="Excluir">
									<f:setPropertyActionListener value="#{item}" 
										 target="#{cadastroMateria.materia}">
									</f:setPropertyActionListener>
							</h:commandLink>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="editar" value="Editar"></h:outputText>
							</f:facet>						
							<h:commandLink action="#{cadastroMateria.Edit}" value="Editar">
								<f:setPropertyActionListener target="#{cadastroMateria.materia}" 
									value="#{item}"  ></f:setPropertyActionListener>
							</h:commandLink>
						</h:column>
					</h:dataTable>
				</h:form>
			</div>
		</ui:define>
	</ui:composition>
</html>